This invention relates to the technology of processing a color image and thereby carrying out a specified image processing on a target object of observation in that image. The invention also relates to the technology of processing a color image of a substrate and carrying out an automatic inspection on a target component part to be inspected contained in that image, as well as to the technology of generating inspection data that are necessary for carrying out such an automatic inspection.
The production process for component-mounting substrates generally include processes for applying a cream solder on a printed circuit board by printing, mounting a component onto an area where the cream solder has been applied and soldering the mounted component onto the substrate by heating it.
When component-mounting substrates are produced by a series of processes as described above, it is preferable to carry out an inspection after each of these processes in order to check whether that process has been performed properly or not. In view thereof, Japanese Patent Koho 3250335, for example, has described a substrate inspection apparatus adapted to automatically inspect a target component part by processing a color image.
Substrate inspection apparatus of this type are generally adapted to generate an image of a target substrate to be inspected (herein referred to as a target image) and to thereafter set an inspection area for each target component part on this target image, extracting in each inspection area pixels having the same color as the target component part by using binarization threshold values each determined for red (R), green (G) or blue (B). The image area formed by the extracted pixels is considered as the target component part, and the appropriateness of such a target component part is judged by comparing its area and position with preliminarily set reference values.
Substrate inspection apparatus of this type are also adapted to make use of an illumination mechanism referred to as the color highlight illumination for inspecting fillets on the substrate after the soldering process at the end. According to this illumination mechanism, beams of colored light in red, green and blue are projected onto the substrate with different angles of elevation, the elevation angle of the red light being the largest, the of the green light being smaller and that of the blue light being the smallest. The camera for taking the image of the substrate is set so as to have its optical axis oriented vertically, and the light sources are arranged so as to surround this optical axis. With the optical system thus formed, the camera receives beams of light with different colors according to the slope of the solder, and a fillet appears on the generated image as a pattern of colors R, G and B.
When a fillet is inspected, color patterns of R, G and B in an inspection area are individually extracted, and the appropriateness of position and size is judged for each color pattern. In this manner, the appropriateness of the sloped condition of a solder can be determined with a high degree of accuracy.
Prior art substrate inspection apparatus are adapted to extract a target component part by a binarization method. As the brightness of the surrounding environment changes, however, the brightness of the substrate surface may change and a shadow may be cast on the target component part. In the presence of such a change, the color condition of the target component part changes and it may become impossible to accurately extract a target component part merely by using a preliminarily set threshold value.
In the case of a general image processing (not necessarily for the inspection of a substrate), too, there are situations where the tint (or hue) of a target object to be observed varies because of changes in the illumination and individual differences among different target objects. Thus, a target object may not be accurately extracted if its color is determined to be within a particular range and only colors contained within this range are to be extracted.